#include "Logger.h"
#include<iostream>
tmms::base::Logger::Logger(const FileLogPtr& log):log_(log)
{

}
void tmms::base::Logger::SetLogLevel(const LogLevel &level)
{
    level_ = level;
}

tmms::base::LogLevel tmms::base::Logger::GetLogLevel() const
{
    return level_;
}

void tmms::base::Logger::Write(const std::string &msg)
{
    if(log_){
        log_->WriteLog(msg);
    }else{
        std::cout<<msg<<std::endl;
    }
}
